<!DOCTYPE html>
<%@page import="com.faeple.util.SessionManager"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ page language="java" contentType="text/html;  charset=utf-8" pageEncoding="utf-8"%>
<html lang="ko">
	<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
	
	<title>Faeple</title>
	
	<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
	<!--[if lt IE 9]>
		<script src="/resources/js/html5shiv.js"></script>
		<script src="/resources/js/respond.min.js"></script>
	<![endif]-->
	<link href='http://fonts.googleapis.com/css?family=Alef' rel='stylesheet' type='text/css'>
	<link rel="stylesheet" href="/resources/css/font-awesome.css">
	<link rel="stylesheet" href="http://fonts.googleapis.com/earlyaccess/nanumgothic.css">
	<style type="text/css">
		body {
			color:#333;
		}
		.time { position: absolute; right: 12px; top:8px; color:#888; }
	</style>
</head>
<body>
<%@ include file="menu.jsp" %>

<div class="container">
	<div class="page-header">
		<h2 id="tables">1:1문의</h2>
    </div>
	<div>
		<div style="margin-bottom:25px;">
			작성자 : 
			<c:choose>
				<c:when test="${inquiry.member_idx eq '0'}">
					${inquiry.name}
				</c:when>
				<c:otherwise>
					<a href="/${inquiry.member_id}" target="_blank">${inquiry.name}</a>
				</c:otherwise>
			</c:choose>
		</div>
		<h4>문의내용 :</h4>
		<div class="panel panel-default">
			<div class="panel-heading" style="position:relative;">
				<h3 class="panel-title">${inquiry.title}</h3>
				<span class="time">${fn:substring(inquiry.createdate,0,16)}</span>
			</div>
			<div class="panel-body">
				${inquiry.content}
			</div>
		</div>
	</div>
</div>

<div class="container">
	<h4>답변 :</h4>
	<form action="/config/admin/inquiryReply" id="reply-form" method="post">
		<div class="panel panel-default">
			<div class="panel-body" style="padding:0;">
				<input type="hidden" id="idx" name="idx" value="${inquiry.idx}">
				<input type="hidden" id="member_idx" name="member_idx" value="${inquiry.member_idx}">
				<textarea name="reply" id="reply" rows="10" cols="100" style="width:100%; height:412px; display:none;">${inquiry.reply_content}</textarea>
			</div>
		</div>
	</form>
	
	<div>
		<div style="float:left;">
			<a href="/config/admin/inquiry" class="btn btn-default">목록</a>
		</div>
		<div style="float:right;">
			<button type="button" class="btn btn-primary" onclick="replySubmit()">답변</button>
		</div>
		<div class="clearfix"></div>
	</div>
</div>
</body>
<script src="/resources/js/jquery-1.11.0.js"></script>
<script src="/resources/js/jquery-ui-1.10.4.custom.min.js"></script>
<script src="/resources/js/bootstrap.js"></script>
<script src="/resources/SmartEditor/js/HuskyEZCreator.js"></script>
<script type="text/javascript">

	var oEditors = [];
	
	//추가 글꼴 목록
	//var aAdditionalFontSet = [["MS UI Gothic", "MS UI Gothic"], ["Comic Sans MS", "Comic Sans MS"],["TEST","TEST"]];
	
	nhn.husky.EZCreator.createInIFrame({
		oAppRef: oEditors,
		elPlaceHolder: "reply",
		sSkinURI: "/resources/SmartEditor/SmartEditor2Skin.html",	
		htParams : {
			bUseToolbar : true,				// 툴바 사용 여부 (true:사용/ false:사용하지 않음)
			bUseVerticalResizer : true,		// 입력창 크기 조절바 사용 여부 (true:사용/ false:사용하지 않음)
			bUseModeChanger : true,			// 모드 탭(Editor | HTML | TEXT) 사용 여부 (true:사용/ false:사용하지 않음)
			//aAdditionalFontList : aAdditionalFontSet,		// 추가 글꼴 목록
			fOnBeforeUnload : function(){
				//alert("완료!");
			}
		}, //boolean
		fOnAppLoad : function(){
			//예제 코드
			//oEditors.getById["ir1"].exec("PASTE_HTML", ["로딩이 완료된 후에 본문에 삽입되는 text입니다."]);
		},
		fCreator: "createSEditor2"
	});

	$(function(){
		$(".navbar-nav").children("li").eq(5).addClass("active");
	});
	
	function replySubmit(){
		oEditors.getById["reply"].exec("UPDATE_CONTENTS_FIELD", []);
		$("#reply-form").submit();	
	}
</script>
</html>